using System;
using System.Diagnostics;
using System.Threading;
using System.Windows;
using Microsoft.Phone.Reactive;

namespace MC.Phone.Ads.Provider
{
    public class NoneAdProvider : BaseAdProvider
    {
        public override string Name
        {
            get { return "None"; }
        }

        public override FrameworkElement ProvideAd()
        {
            OnNewAd();
            Observable.Interval(TimeSpan.FromSeconds(60))
                .Take(1)
                .ObserveOnDispatcher()
                .Subscribe(l => OnNoAd());
            return null;
        }

        public override void Clean()
        {
        }

#if DEBUG
        ~NoneAdProvider()
        {
            Debug.WriteLine( Thread.CurrentThread.ManagedThreadId + "--Finalizing " + GetType().FullName);
        }
#endif
    }
}